#!/bin/sh
# how many time this sh script has been excuted

# circular counting
if [ ! -d /tmp/sandbox ]; then
        mkdir /tmp/sandbox
fi

f=/tmp/sandbox/counter
if [ -s $f ]; then
        n=$(cat "$f")
        n=$(($n+1))
        if [ "$n" -ge 4 ]; then
                n=1
        fi
else
        n=1
fi
echo "$n">"$f"
echo "Run Times =$n"

case $n in
        1) user=u1@gmail.com ; passwd=p1 ;;
        2) user=u2@outlook.com ; passwd=p2 ;;
        3) user=u3@gmx.com ; passwd=p3 ;;
        *) echo "mycirc.sh: error - Invalid number" ;;
esac
#echo $user+$passwd
/etc/MySH/myemail-agent $user $passwd
